let baseUrl='https://douban.uieee.com/v2/movie/';
function http({url,data}){
    return new Promise((resolve,reject)=>{
        wx.request({
            url:baseUrl+url,
            data,
            header: {'content-type':'application/text'},
            method: 'GET',
            dataType: 'json',
            responseType: 'text',
            success: (res)=>{
                resolve(res)
            },
            fail: (err)=>{
                reject(err)
            },
            
        })
    })
}
module.exports={
    getData:(start)=>{
        return http({
            url:"top250",
            data:{
                start,
            }
        })
    },
    getContent:(id)=>{
        return http({
            url:`subject/${id}`
        })
    }
}